package fenyu.personblob.web.model;

import fenyu.personblob.bean.databean.User;
import fenyu.personblob.bean.databean.user.AdminUser;
import fenyu.personblob.bean.databean.user.DefaultUser;

/**
 * create at 2018/12/22 10:38
 *
 * @author 纷羽 <gzj0078@gmail.com>
 */
public class UserShow {

    private Integer id;

    private String username;

    private String nickname;

    private String identify;

    public UserShow(User user) {
        if (user instanceof AdminUser)
            this.identify = "admin";
        else if (user instanceof DefaultUser)
            this.identify = "default";
        else
            this.identify = "custom";
        this.username = user.getUsername();
        this.id = user.getId();
        this.nickname = user.getNickname();
    }

    public String getUsername() {
        return username;
    }

    public String getNickname() {
        return nickname;
    }

    public String getIdentify() {
        return identify;
    }

    public Integer getId() {
        return id;
    }
}
